import request from "@/utils/request";
import defaultSettings from "@/settings";

export const kvApiUrlConfig = {
  queryUrl: `${defaultSettings.ctx.batchApp}/s/scubeKvParam/list`,
  exportUrl: `${defaultSettings.ctx.batchApp}/s/scubeKvParam/list`,
  delUrl: `${defaultSettings.ctx.batchApp}/s/scubeKvParam/delete`,
}

export function saveKv(data) {
  return request({
    url: `${defaultSettings.ctx.batchApp}/s/scubeKvParam/save`,
    method: 'post',
    data: data
  })
}

export function getKv(data) {
  return request({
    url: `${defaultSettings.ctx.batchApp}/s/scubeKvParam/get`,
    method: 'get',
    params: data
  })
}

export function checkParamKeyUnique(data) {
  return request({
    url: `${defaultSettings.ctx.batchApp}/s/scubeKvParam/checkParamKeyUnique`,
    method: 'post',
    data
  })
}

export function updateKv(data) {
  return request({
    url: `${defaultSettings.ctx.batchApp}/s/scubeKvParam/update`,
    method: 'post',
    data: data
  })
}

export function delKv(data) {
  return request({
    url: `${defaultSettings.ctx.batchApp}/s/scubeKvParam/delete`,
    method: 'post',
    data: {
      ids: data
    }
  })
}
